"use strict";
const async = require("async");
const mongo = require('mongodb');
const ObjectID = mongo.ObjectID;

module.exports = {
    description:'七牛上传回调',
    handler(req, res, next) {

        let body = req.body;
        body._id = new ObjectID(body._id);
        body.projectId = body.projectId? new ObjectID(body.projectId):null;
        body.userId = body.userId? new ObjectID(body.userId):null;
        body.companyId = body.companyId? new ObjectID(body.companyId):null;

        req.mongo.collection('file').insertOne(body,(e,r)=>{
            console.log('回调插入数据：：：', e,body);
            res.reply({code:0,message:'回调成功'});
        });

    }
}